describe('App.SecurityController',function(){
    var controller;

    beforeEach(function(){
        var t_alertCtrl = App.AlertController.create();
        var t_loadingCtrl = App.LoadingController.create();

        App.SecurityController.reopen({

            init:function(){
                this.set('controllers', Em.Object.create({
                    alert: t_alertCtrl,
                    loading: t_loadingCtrl
                }));
            }

        });

        controller = App.SecurityController.create();
    });

    it("addMoveNavigationItems",function(){
        expect(controller.isMoveMenuEnabled()).toBe(false);
        spyOn(controller,'addMoveNavigationItems');
        controller.addMoveNavigationItems();
        controller.addNavigationItems();
        expect(controller.addMoveNavigationItems).toHaveBeenCalled();
    });

    it("addNavigationItems",function(){
        expect(controller.isMoveMenuEnabled()).toBe(false);
        spyOn(controller,'addNavigationItems');
        controller.addMoveNavigationItems();
        controller.addNavigationItems();
        expect(controller.addNavigationItems).toHaveBeenCalled();
    });

    it("isMoveMenuEnabled--Attribute is not none",function(){
        App.getSession().setAttribute('showMoveMenu',true);
        expect(Ember.none(App.getSession().getAttribute('showMoveMenu'))).toBe(false);
        expect(controller.isMoveMenuEnabled()).toBe(true);
    });

    it("moveNavItems",function(){
        var items =[{
            "title": "My Accounts",
            "link": "move",
            "className": "",
            "param": "App.OwnAccountTransfer",
            "id": "App.OwnAccountTransfer"
        }, {
            "title": "Other Accounts",
            "subTitle": '',
            "link": "move",
            "className": "",
            "param": "App.ThirdPartyTransfer",
            "id": "App.ThirdPartyTransfer"
        },{
            "title": "My Cards",
            "link": "move",
            "className": "",
            "param": "App.CreditCardPayment",
            "id": "App.CreditCardPayment"
        }, {
            "title": "Bill Payment",
            "link": "move",
            "className": "",
            "param": "App.BillPayment",
            "id": "App.BillPayment"
        }, {
            "title": "One Time Bill Payment",
            "link": "move",
            "className": "",
            "param": "App.OneTimeBillPayment",
            "id": "App.OneTimeBillPayment"
        }, {
            "title": "Top Up",
            "link": "move",
            "className": "",
            "param": "App.TopUpPayment",
            "id": "App.TopUpPayment"
        }, {
            "title": "One Time Top Up",
            "link": "move",
            "className": "",
            "param": "App.OneTimeTopUpPayment",
            "id": "App.OneTimeTopUpPayment"
        }, {
            "title": "Transfer History",
            "link": "move.transferHistory",
            "className": "",
            "param": "",
            "id": "transferHistory"
        }
        ];
        expect(JSON.stringify(controller.moveNavItems())).toBe(JSON.stringify(items));
    });
});